<template>
  <div className="all">
    <!--    <head-layout/>-->
    <!--    头部-->
    <div class="banner">
      <img src="@/assets/YNU.jpg">
      <div class="line"></div>
      <div class="sname">
        <span>{{ Course.name }}</span>
        <span class="type">{{ Course.description }}</span>
        <p>{{ Course.teacher }}</p>
      </div>
      <el-button round><el-icon><Clock /></el-icon>我的学习时长</el-button>
    </div>

    <div className="middle">
      <!--      导航-->
      <SideNavigator/>
      <!--      具体内容-->
      <div className="right">
        <a href="">点击此处跳转</a>
        <el-empty description="没有东西啦"></el-empty>

      </div>
    </div>
  </div>
</template>

<script lang="ts" setup>
import SideNavigator from '@/components/SideNavigator.vue'

import {
  Clock,
} from '@element-plus/icons-vue'
import {onMounted, ref} from "vue";
import {CourseStore} from "@/store";
import axios from "axios";
const Course = ref({
  name: '',
  description: '',
  teacher: ''
})
const coursestore = CourseStore()
const load_course = () =>{
  axios.get('/course/'+ coursestore.course_id)
      .then(function(res){
        Course.value = res.data.data.data
        console.log(res.data.data)
        axios.get('/teachercourse/findteacher?cid='+coursestore.course_id)
            .then(function(ans){
              Course.value.teacher = ans.data.data[0].name
              console.log(ans.data.data)
              console.log(ans.data.data[0].name)
            })
      })
}

onMounted(async ()=>{
  load_course()
})

</script>

<style scoped>
/*整体布局*/
.all {
  overflow-x: hidden;
  background-color: rgba(240, 242, 245, 1);
}

/*头部*/
.banner {
  background-color: #fff;
  border: 1px solid rgba(0, 21, 41, 0.12);
  padding: 10px 32px;
  /*border-radius: 20px;*/
  width: 100%;
  height: 50px;
  overflow-x: hidden;
  position: relative;
  margin-bottom: 10px;
  margin-top: -10px;
}

.banner img {
  width: 108px;
  height: 40px;
  margin-top: 5px;
  margin-right: 100px;
}

.line {
  background: #CFD3DC; /*背景色为浅灰色*/
  width: 0.8px; /*设置宽高*/
  height: 45px;
  position: relative; /*调整位置*/
  left: 150px;
  float: left; /*让此div与前面的并排显示*/
}

.all .banner .sname {
  margin-left: 175px;
  margin-top: -40px;
  line-height: 0.6;
}

.all .banner .sname span {
  color: #333333;
  font-size: 18px;
  font-weight: bold;
}

.all .banner .sname .type {
  background-color: #CBA265;
  border-radius: 5px;
  font-weight: normal;
  font-size: 12px;
  color: white;
  /*上右下左*/
  margin-left: 10px;
  padding: 2px 6px;
  vertical-align: middle;
}

.all .banner .sname p {
  color: #00CC7E;
  font-size: 12px;
}

.el-button.is-round {
  position: absolute;
  right: 90px;
  top: 20px;
}

/*下方*/
.middle {
  display: flex;
  /*justify-content: space-between;*/
  width: 100%;
}

.left {
  margin-top: 20px;
  background: #fff;
  width: 300px;
  border-radius: 6px;
  margin-left: 20px;
}

.menu {
  height: 356px;
}

.all .middle .left .menu .el-menu {
  width: 300px;
  border-radius: 6px;
  font-size: 14px;
}

.text {
  height: 300px;
  font-size: small;

}

.right {
  margin-top: 20px;
  background: #fff;
  width: 100%;
  border-radius: 6px;
  margin-right: 20px;
  margin-left: 20px;
}

.el-divider--horizontal {
  width: 90%;
  margin-left: 5%;
  margin-top: 10px;
}

.text {
  margin-left: 10%;
}

a {
  text-decoration: none;
  color: #666666
}

a.router-link-active {
  color: #00CC7E;
}

.router-link-active {
  text-decoration: none;
  color: #00CC7E;
}

</style>
